package com.github.catvod.spider;

import android.content.Context;
import android.net.UrlQuerySanitizer;
import android.text.TextUtils;
import com.github.catvod.crawler.Spider;
import com.github.catvod.crawler.SpiderDebug;
import com.github.catvod.spider.merge.CE;
import com.github.catvod.spider.merge.Dv;
import com.github.catvod.spider.merge.HZ;
import com.github.catvod.spider.merge.L;
import com.github.catvod.spider.merge.Lm;
import com.github.catvod.spider.merge.fP;
import com.github.catvod.spider.merge.lk;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.Call;
import okhttp3.Response;
import org.json.JSONArray;
import org.json.JSONObject;

/* loaded from: classes.dex */
public class PushAgent extends Spider {
    private static long V0 = 0;
    private static String h = "";
    public static String u;
    private static final Map<String, String> j = new HashMap();
    private static final Map<String, Long> q = new HashMap();
    private static final Map<String, Map<String, String>> I = new HashMap();
    private static final ReentrantLock oC = new ReentrantLock();
    private static final Pattern BQ = Pattern.compile("(https://www.aliyundrive.com/s/[^\"]+)");
    public static Pattern W = Pattern.compile("www.aliyundrive.com/s/([^/]+)(/folder/([^/]+))?");

    private static HashMap<String, String> BQ() {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36");
        return hashMap;
    }

    private static synchronized String I(String str, String str2) {
        synchronized (PushAgent.class) {
            try {
                long j2 = j();
                Map<String, String> map = j;
                String str3 = map.get(str);
                Map<String, Long> map2 = q;
                Long l = map2.get(str);
                if (!TextUtils.isEmpty(str3) && l.longValue() - j2 > 600) {
                    return str3;
                }
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("share_id", str);
                jSONObject.put("share_pwd", str2);
                JSONObject jSONObject2 = new JSONObject(V0("https://api.aliyundrive.com/v2/share_link/get_share_token", jSONObject.toString(), h()));
                String string = jSONObject2.getString("share_token");
                map2.put(str, Long.valueOf(j2 + jSONObject2.getLong("expires_in")));
                map.put(str, string);
                return string;
            } catch (Exception e) {
                SpiderDebug.log(e);
                return "";
            }
        }
    }

    public static Object[] ProxyMedia(Map<String, String> map) {
        try {
            String str = map.get("share_id");
            String str2 = map.get("file_id");
            String str3 = map.get("media_id");
            String I2 = I(str, "");
            ReentrantLock reentrantLock = oC;
            reentrantLock.lock();
            Map<String, Map<String, String>> map2 = I;
            String str4 = map2.get(str2).get(str3);
            if (new Long(new UrlQuerySanitizer(str4).getValue("x-oss-expires")).longValue() - j() <= 60) {
                q(str, I2, str2);
                str4 = map2.get(str2).get(str3);
            }
            reentrantLock.unlock();
            new HashMap();
            L.Tw tw = new L.Tw() { // from class: com.github.catvod.spider.PushAgent.1
                @Override // com.github.catvod.spider.merge.L
                protected void onFailure(Call call, Exception exc) {
                }

                @Override // com.github.catvod.spider.merge.L
                public String onResponse(Response response) {
                    return null;
                }
            };
            fP.q(fP.j(), str4, null, h(), tw);
            return new Object[]{200, "video/MP2T", tw.getResult().body().byteStream()};
        } catch (Exception e) {
            SpiderDebug.log(e);
            return null;
        }
    }

    private static String V0(String str, String str2, Map<String, String> map) {
        L.yh yhVar = new L.yh() { // from class: com.github.catvod.spider.PushAgent.2
            @Override // com.github.catvod.spider.merge.L
            protected void onFailure(Call call, Exception exc) {
            }

            @Override // com.github.catvod.spider.merge.L
            public String onResponse(String str3) {
                return str3;
            }
        };
        fP.W(fP.j(), str, str2, map, yhVar);
        return yhVar.getResult();
    }

    public static Object[] getFile(Map<String, String> map) {
        try {
            String str = map.get("share_id");
            return new Object[]{200, "application/octet-stream", new ByteArrayInputStream(q(str, I(str, ""), map.get("file_id")).getBytes())};
        } catch (Exception e) {
            SpiderDebug.log(e);
            return null;
        }
    }

    private static HashMap<String, String> h() {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.54 Safari/537.36");
        hashMap.put("Referer", "https://www.aliyundrive.com/");
        return hashMap;
    }

    protected static long j() {
        return (System.currentTimeMillis() / 1000) + 0;
    }

    private static void oC() {
        long j2 = j();
        if (h.isEmpty() || V0 - j2 <= 600) {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("refresh_token", u);
                JSONObject jSONObject2 = new JSONObject(V0("https://api.aliyundrive.com/token/refresh", jSONObject.toString(), h()));
                h = jSONObject2.getString("token_type") + " " + jSONObject2.getString("access_token");
                V0 = j2 + jSONObject2.getLong("expires_in");
            } catch (Exception e) {
                SpiderDebug.log(e);
            }
        }
    }

    private static String q(String str, String str2, String str3) {
        int i;
        JSONObject jSONObject;
        try {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("share_id", str);
            jSONObject2.put("category", "live_transcoding");
            jSONObject2.put("file_id", str3);
            jSONObject2.put("template_id", "");
            HashMap<String, String> h2 = h();
            h2.put("x-share-token", str2);
            h2.put("authorization", h);
            JSONObject jSONObject3 = new JSONObject(V0("https://api.aliyundrive.com/v2/file/get_share_link_video_preview_play_info", jSONObject2.toString(), h2));
            ArrayList arrayList = new ArrayList();
            arrayList.add("FHD");
            arrayList.add("HD");
            arrayList.add("SD");
            JSONArray jSONArray = jSONObject3.getJSONObject("video_preview_play_info").getJSONArray("live_transcoding_task_list");
            Iterator it = arrayList.iterator();
            String str4 = "";
            while (true) {
                i = 0;
                if (!it.hasNext()) {
                    break;
                }
                String str5 = (String) it.next();
                if (!str4.isEmpty()) {
                    break;
                }
                while (true) {
                    if (i < jSONArray.length()) {
                        jSONObject = jSONArray.getJSONObject(i);
                        if (jSONObject.getString("template_id").equals(str5)) {
                            break;
                        }
                        i++;
                    }
                }
                str4 = jSONObject.getString("url");
            }
            if (TextUtils.isEmpty(str4)) {
                str4 = jSONArray.getJSONObject(0).getString("url");
            }
            HashMap hashMap = new HashMap();
            fP.i4(str4, h(), hashMap);
            String I2 = fP.I(hashMap);
            String oq = fP.oq(I2, h());
            String str6 = I2.substring(0, I2.lastIndexOf("/")) + "/";
            ArrayList arrayList2 = new ArrayList();
            HashMap hashMap2 = new HashMap();
            String[] split = oq.split("\n");
            int length = split.length;
            int i2 = 0;
            while (i < length) {
                String str7 = split[i];
                if (str7.contains("x-oss-expires")) {
                    i2++;
                    hashMap2.put("" + i2, str6 + str7);
                    str7 = Proxy.localProxyUrl() + "?do=push&type=media&share_id=" + str + "&file_id=" + str3 + "&media_id=" + i2;
                }
                arrayList2.add(str7);
                i++;
            }
            I.put(str3, hashMap2);
            return TextUtils.join("\n", arrayList2);
        } catch (Exception e) {
            SpiderDebug.log(e);
            return "";
        }
    }

    public static Object[] vod(Map<String, String> map) {
        String str = map.get("type");
        if (str.equals("m3u8")) {
            return getFile(map);
        }
        if (str.equals("media")) {
            return ProxyMedia(map);
        }
        return null;
    }

    public String detailContent(List<String> list) {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        String str7;
        String str8;
        String str9;
        String str10;
        String str11;
        String str12;
        String str13;
        String str14 = "";
        try {
            String str15 = list.get(0);
            Pattern pattern = W;
            Matcher matcher = BQ.matcher(str15);
            Matcher matcher2 = pattern.matcher(str15);
            String str16 = "vod_remarks";
            String str17 = "vod_area";
            if (CE.oC(str15) && !str15.contains("qq.com") && !str15.contains("mgtv.com")) {
                String I2 = lk.h(fP.oq(str15, null)).Pi("head > title").I();
                JSONObject jSONObject = new JSONObject();
                JSONArray jSONArray = new JSONArray();
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("vod_id", str15);
                jSONObject2.put("vod_name", I2);
                jSONObject2.put("vod_pic", "https://img.zcool.cn/community/0123545c74c5aea801213f261297df.png");
                jSONObject2.put("type_name", "官源");
                jSONObject2.put("vod_year", "");
                jSONObject2.put("vod_area", "");
                jSONObject2.put("vod_remarks", "");
                jSONObject2.put("vod_actor", "");
                jSONObject2.put("vod_director", "");
                jSONObject2.put("vod_content", "");
                jSONObject2.put("vod_play_from", "jx");
                jSONObject2.put("vod_play_url", "立即播放$" + str15);
                jSONArray.put(jSONObject2);
                jSONObject.put("list", jSONArray);
                return jSONObject.toString();
            }
            if (CE.oC(str15) && str15.contains("qq.com")) {
                ArrayList arrayList = new ArrayList();
                JSONObject jSONObject3 = new JSONObject();
                JSONArray jSONArray2 = new JSONArray();
                JSONObject jSONObject4 = new JSONObject();
                HZ h2 = lk.h(fP.oq(str15, BQ()));
                String I3 = h2.Pi("head > title").I();
                Dv Pi = h2.Pi("div.episode-list-rect__item");
                try {
                    if (Pi.isEmpty()) {
                        str11 = "";
                        str12 = "vod_remarks";
                        str13 = "vod_area";
                        jSONObject4.put("vod_play_url", "立即播放$" + str15);
                    } else {
                        int i = 0;
                        while (i < Pi.size()) {
                            Lm lm = Pi.get(i);
                            Dv dv = Pi;
                            String str18 = str16;
                            String h3 = lm.Pi("div").h("data-vid");
                            String str19 = str17;
                            String h4 = lm.Pi("div").h("data-cid");
                            StringBuilder sb = new StringBuilder();
                            String str20 = str14;
                            sb.append("https://v.qq.com/x/cover/");
                            sb.append(h4);
                            sb.append("/");
                            sb.append(h3);
                            String sb2 = sb.toString();
                            arrayList.add(lm.Pi("div span").I() + "$" + sb2);
                            i++;
                            Pi = dv;
                            str16 = str18;
                            str17 = str19;
                            str14 = str20;
                        }
                        str11 = str14;
                        str12 = str16;
                        str13 = str17;
                        jSONObject4.put("vod_play_url", TextUtils.join("#", arrayList));
                    }
                    jSONObject4.put("vod_id", str15);
                    jSONObject4.put("vod_name", I3);
                    jSONObject4.put("vod_pic", "https://img2.baidu.com/it/u=2655029475,2190949369&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=593");
                    jSONObject4.put("type_name", "腾讯TV");
                    String str21 = str11;
                    jSONObject4.put("vod_year", str21);
                    jSONObject4.put(str13, str21);
                    jSONObject4.put(str12, str21);
                    jSONObject4.put("vod_actor", str21);
                    jSONObject4.put("vod_director", str21);
                    jSONObject4.put("vod_content", str15);
                    jSONObject4.put("vod_play_from", "jx");
                    jSONArray2.put(jSONObject4);
                    jSONObject3.put("list", jSONArray2);
                    return jSONObject3.toString();
                } catch (Throwable unused) {
                    return str11;
                }
            }
            String str22 = "list";
            if (!CE.oC(str15)) {
                str = str22;
                str2 = "vod_play_from";
                str3 = "vod_content";
            } else {
                if (str15.contains("mgtv.com")) {
                    ArrayList arrayList2 = new ArrayList();
                    JSONObject jSONObject5 = new JSONObject();
                    JSONArray jSONArray3 = new JSONArray();
                    JSONObject jSONObject6 = new JSONObject();
                    Matcher matcher3 = Pattern.compile("https://\\S+mgtv.com/b/(\\d+)/(\\d+).html.*").matcher(str15);
                    if (matcher3.find()) {
                        str8 = "vod_actor";
                        StringBuilder sb3 = new StringBuilder();
                        str7 = "vod_remarks";
                        sb3.append("https://pcweb.api.mgtv.com/episode/list?video_id=");
                        sb3.append(matcher3.group(2));
                        str6 = "vod_area";
                        JSONObject jSONObject7 = new JSONObject(fP.oq(sb3.toString(), h()));
                        String string = jSONObject7.getJSONObject("data").getJSONObject("info").getString("title");
                        JSONArray jSONArray4 = new JSONArray(jSONObject7.getJSONObject("data").getString(str22));
                        if (jSONArray4.length() > 0) {
                            int i2 = 0;
                            while (i2 < jSONArray4.length()) {
                                JSONObject jSONObject8 = jSONArray4.getJSONObject(i2);
                                JSONArray jSONArray5 = jSONArray4;
                                if (jSONObject8.getString("isIntact").equals("1")) {
                                    String string2 = jSONObject8.getString("t4");
                                    String string3 = jSONObject8.getString("video_id");
                                    StringBuilder sb4 = new StringBuilder();
                                    str10 = str22;
                                    sb4.append("https://www.mgtv.com/b/");
                                    sb4.append(matcher3.group(1));
                                    sb4.append("/");
                                    sb4.append(string3);
                                    sb4.append(".html");
                                    arrayList2.add(string2 + "$" + sb4.toString());
                                } else {
                                    str10 = str22;
                                }
                                i2++;
                                jSONArray4 = jSONArray5;
                                str22 = str10;
                            }
                            str5 = str22;
                            jSONObject6.put("vod_play_url", TextUtils.join("#", arrayList2));
                        } else {
                            str5 = str22;
                            jSONObject6.put("vod_play_url", "立即播放$" + str15);
                        }
                        str9 = string;
                    } else {
                        str5 = str22;
                        str6 = "vod_area";
                        str7 = "vod_remarks";
                        str8 = "vod_actor";
                        str9 = "";
                    }
                    jSONObject6.put("vod_id", str15);
                    jSONObject6.put("vod_name", str9);
                    jSONObject6.put("vod_pic", "https://img2.baidu.com/it/u=2562822927,704100654&fm=253&fmt=auto&app=138&f=JPEG?w=600&h=380");
                    jSONObject6.put("type_name", "芒果TV");
                    jSONObject6.put("vod_year", "");
                    jSONObject6.put(str6, "");
                    jSONObject6.put(str7, "");
                    jSONObject6.put(str8, "");
                    jSONObject6.put("vod_director", "");
                    jSONObject6.put("vod_content", str15);
                    jSONObject6.put("vod_play_from", "jx");
                    jSONArray3.put(jSONObject6);
                    jSONObject5.put(str5, jSONArray3);
                    return jSONObject5.toString();
                }
                str = str22;
                str3 = "vod_content";
                str2 = "vod_play_from";
            }
            if (CE.I(str15)) {
                JSONObject jSONObject9 = new JSONObject();
                JSONArray jSONArray6 = new JSONArray();
                JSONObject jSONObject10 = new JSONObject();
                jSONObject10.put("vod_id", str15);
                jSONObject10.put("vod_name", str15);
                jSONObject10.put("vod_pic", "https://img.zcool.cn/community/0123545c74c5aea801213f261297df.png");
                jSONObject10.put("type_name", "直连");
                jSONObject10.put(str2, "player");
                jSONObject10.put("vod_play_url", "立即播放$" + str15);
                jSONArray6.put(jSONObject10);
                jSONObject9.put(str, jSONArray6);
                return jSONObject9.toString();
            }
            if (str15.startsWith("magnet")) {
                if (str15.length() > 100) {
                    str4 = str15.substring(0, 30) + "..." + str15.substring(str15.length() - 10);
                } else {
                    str4 = str15;
                }
                JSONObject jSONObject11 = new JSONObject();
                JSONArray jSONArray7 = new JSONArray();
                JSONObject jSONObject12 = new JSONObject();
                jSONObject12.put("vod_id", str15);
                jSONObject12.put("vod_name", str4);
                jSONObject12.put("vod_pic", "https://img2.baidu.com/it/u=1609185522,4130752057&fm=253&f=JPEG");
                jSONObject12.put("type_name", "磁力");
                jSONObject12.put(str2, "磁力测试");
                jSONObject12.put("vod_play_url", "立即播放$" + str15);
                jSONArray7.put(jSONObject12);
                jSONObject11.put(str, jSONArray7);
                return jSONObject11.toString();
            }
            if (str15.startsWith("http") && matcher.find()) {
                return getAliContent(list);
            }
            if (!str15.startsWith("http") || matcher2.find() || matcher.find()) {
                return "";
            }
            String I4 = lk.h(fP.oq(str15, null)).Pi("head > title").I();
            JSONObject jSONObject13 = new JSONObject();
            JSONArray jSONArray8 = new JSONArray();
            JSONObject jSONObject14 = new JSONObject();
            jSONObject14.put("vod_id", str15);
            jSONObject14.put("vod_name", I4);
            jSONObject14.put("vod_pic", "https://pic.rmb.bdstatic.com/bjh/1d0b02d0f57f0a42201f92caba5107ed.jpeg");
            jSONObject14.put("type_name", "嗅探");
            jSONObject14.put(str3, str15);
            jSONObject14.put(str2, "嗅探");
            jSONObject14.put("vod_play_url", "立即播放嗅探$" + str15);
            jSONArray8.put(jSONObject14);
            jSONObject13.put(str, jSONArray8);
            return jSONObject13.toString();
        } catch (Throwable unused2) {
            return "";
        }
    }

    public String getAliContent(List<String> list) {
        try {
            String trim = list.get(0).trim();
            Matcher matcher = W.matcher(trim);
            if (!matcher.find()) {
                return "";
            }
            String group = matcher.group(1);
            String group2 = matcher.groupCount() == 3 ? matcher.group(3) : "";
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("share_id", group);
            JSONObject jSONObject2 = new JSONObject(V0("https://api.aliyundrive.com/adrive/v3/share_link/get_share_by_anonymous", jSONObject.toString(), h()));
            JSONArray jSONArray = jSONObject2.getJSONArray("file_infos");
            if (jSONArray.length() == 0) {
                return "";
            }
            JSONObject jSONObject3 = null;
            if (TextUtils.isEmpty(group2)) {
                jSONObject3 = jSONArray.getJSONObject(0);
                group2 = jSONObject3.getString("file_id");
            } else {
                int i = 0;
                while (true) {
                    if (i >= jSONArray.length()) {
                        break;
                    }
                    JSONObject jSONObject4 = jSONArray.getJSONObject(i);
                    if (jSONObject4.getString("file_id").equals(jSONObject4.getString("file_id"))) {
                        jSONObject3 = jSONObject4;
                        break;
                    }
                    i++;
                }
                if (jSONObject3 == null) {
                    return "";
                }
            }
            JSONObject jSONObject5 = new JSONObject();
            jSONObject5.put("vod_id", trim);
            jSONObject5.put("vod_name", jSONObject2.getString("share_name"));
            jSONObject5.put("vod_pic", jSONObject2.getString("avatar"));
            jSONObject5.put("vod_content", trim);
            jSONObject5.put("vod_play_from", "AliYun");
            ArrayList arrayList = new ArrayList();
            if (!jSONObject3.getString("type").equals("folder")) {
                if (jSONObject3.getString("type").equals("file")) {
                    jSONObject3.getString("category").equals("video");
                }
                return "";
            }
            String I2 = I(group, "");
            Map<String, String> hashMap = new HashMap<>();
            listFiles(hashMap, group, I2, group2);
            ArrayList arrayList2 = new ArrayList(hashMap.keySet());
            Collections.sort(arrayList2);
            Iterator it = arrayList2.iterator();
            while (it.hasNext()) {
                String str = (String) it.next();
                arrayList.add(str + "$" + hashMap.get(str));
            }
            ArrayList arrayList3 = new ArrayList();
            for (int i2 = 0; i2 < 4; i2++) {
                arrayList3.add(TextUtils.join("#", arrayList));
            }
            jSONObject5.put("vod_play_url", TextUtils.join("$$$", arrayList3));
            JSONObject jSONObject6 = new JSONObject();
            JSONArray jSONArray2 = new JSONArray();
            jSONArray2.put(jSONObject5);
            jSONObject6.put("list", jSONArray2);
            return jSONObject6.toString();
        } catch (Exception e) {
            SpiderDebug.log(e);
            return "";
        }
    }

    public void init(Context context, String str) {
        super.init(context, str);
        if (str.startsWith("http")) {
            u = fP.oq(str, null);
        } else {
            u = str;
        }
    }

    public void listFiles(Map<String, String> map, String str, String str2, String str3) {
        String str4;
        String str5;
        HashMap<String, String> hashMap;
        JSONObject jSONObject;
        String str6 = "_";
        try {
            String str7 = "https://api.aliyundrive.com/adrive/v3/file/list";
            HashMap<String, String> h2 = h();
            h2.put("x-share-token", str2);
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("image_thumbnail_process", "image/resize,w_160/format,jpeg");
            jSONObject2.put("image_url_process", "image/resize,w_1920/format,jpeg");
            jSONObject2.put("limit", 200);
            jSONObject2.put("order_by", "updated_at");
            jSONObject2.put("order_direction", "DESC");
            jSONObject2.put("parent_file_id", str3);
            jSONObject2.put("share_id", str);
            jSONObject2.put("video_thumbnail_process", "video/snapshot,t_1000,f_jpg,ar_auto,w_300");
            String str8 = "";
            ArrayList arrayList = new ArrayList();
            int i = 1;
            while (i <= 50 && (i < 2 || !TextUtils.isEmpty(str8))) {
                jSONObject2.put("marker", str8);
                JSONObject jSONObject3 = new JSONObject(V0(str7, jSONObject2.toString(), h2));
                JSONArray jSONArray = jSONObject3.getJSONArray("items");
                int i2 = 0;
                while (i2 < jSONArray.length()) {
                    JSONObject jSONObject4 = jSONArray.getJSONObject(i2);
                    if (jSONObject4.getString("type").equals("folder")) {
                        arrayList.add(jSONObject4.getString("file_id"));
                        str5 = str6;
                        str4 = str7;
                    } else {
                        str4 = str7;
                        if (jSONObject4.getString("mime_type").contains("video")) {
                            String replace = jSONObject4.getString("name").replace("#", str6).replace("$", str6);
                            str5 = str6;
                            if (replace.length() > 20) {
                                StringBuilder sb = new StringBuilder();
                                hashMap = h2;
                                jSONObject = jSONObject2;
                                sb.append(replace.substring(0, 10));
                                sb.append("...");
                                sb.append(replace.substring(replace.length() - 10));
                                replace = sb.toString();
                            } else {
                                hashMap = h2;
                                jSONObject = jSONObject2;
                            }
                            map.put(replace, str + "+" + str2 + "+" + jSONObject4.getString("file_id"));
                            i2++;
                            str7 = str4;
                            str6 = str5;
                            h2 = hashMap;
                            jSONObject2 = jSONObject;
                        } else {
                            str5 = str6;
                        }
                    }
                    hashMap = h2;
                    jSONObject = jSONObject2;
                    i2++;
                    str7 = str4;
                    str6 = str5;
                    h2 = hashMap;
                    jSONObject2 = jSONObject;
                }
                str8 = jSONObject3.getString("next_marker");
                i++;
                str7 = str7;
                str6 = str6;
                h2 = h2;
                jSONObject2 = jSONObject2;
            }
            Iterator it = arrayList.iterator();
            while (it.hasNext()) {
                try {
                    listFiles(map, str, str2, (String) it.next());
                } catch (Exception e) {
                    try {
                        SpiderDebug.log(e);
                        return;
                    } catch (Exception e2) {
                        e = e2;
                        SpiderDebug.log(e);
                        return;
                    }
                }
            }
        } catch (Exception e3) {
            e = e3;
        }
    }

    public String playerContent(String str, String str2, List<String> list) {
        char c = 65535;
        try {
            int hashCode = str.hashCode();
            if (hashCode != -985752863) {
                if (hashCode != 3406) {
                    if (hashCode != 706173) {
                        if (hashCode == 1963852404 && str.equals("AliYun")) {
                            c = 3;
                        }
                    } else if (str.equals("嗅探")) {
                        c = 2;
                    }
                } else if (str.equals("jx")) {
                    c = 0;
                }
            } else if (str.equals("player")) {
                c = 1;
            }
        } catch (Exception e) {
            e.printStackTrace();
            SpiderDebug.log(e);
        }
        if (c == 0) {
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("parse", 1);
            jSONObject.put("jx", "1");
            jSONObject.put("url", str2);
            return jSONObject.toString();
        }
        if (c == 1) {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("parse", 0);
            jSONObject2.put("playUrl", "");
            jSONObject2.put("url", str2);
            return jSONObject2.toString();
        }
        if (c == 2) {
            JSONObject jSONObject3 = new JSONObject();
            jSONObject3.put("parse", 1);
            jSONObject3.put("playUrl", "");
            jSONObject3.put("url", str2);
            return jSONObject3.toString();
        }
        if (c == 3) {
            oC();
            String[] split = str2.split("\\+");
            String str3 = Proxy.localProxyUrl() + "?do=push&type=m3u8&share_id=" + split[0] + "&file_id=" + split[2];
            JSONObject jSONObject4 = new JSONObject();
            jSONObject4.put("parse", "0");
            jSONObject4.put("playUrl", "");
            jSONObject4.put("url", str3);
            jSONObject4.put("header", "");
            return jSONObject4.toString();
        }
        return "";
    }
}
